<Select ShowSearch
        Style="width:200px"
        Placeholder="input search text"
        ShowArrow="false"
        FilterOption="false"
        DefaultActiveFirstOption="false"
        OnSearch="@OnSearch"
        OnChange="@OnChange">
    @foreach (var value in _items)
    {
        <SelectOption Value="@value">@value</SelectOption>
    }
</Select>

@using OneOf;
@using System.Web;
@using System.Text.Json;
@inject HttpClient Http
@code
{
    private Task<string> _oldTask;
    private List<string> _items = new List<string>();

    private async void OnSearch(string value)
    {
        if (!string.IsNullOrWhiteSpace(value))
        {
            if (_oldTask == null || _oldTask.IsCompleted)
            {
                var key = HttpUtility.UrlEncode(value);
                var url = $"https://suggest.taobao.com/sug?code=utf-8&q={key}";

                _oldTask = Http.GetStringAsync(url);
                var content = await _oldTask;

                var result = JsonSerializer.Deserialize<ApiResult>(content);
                _items.Clear();
                foreach (var item in result.result)
                {
                    _items.Add(item[0]);
                }

                StateHasChanged();
            }
        }
    }

    private void OnChange(OneOf<string, IEnumerable<string>, LabeledValue, IEnumerable<LabeledValue>> value, OneOf<SelectOption, IEnumerable<SelectOption>> option)
    {
        Console.WriteLine($"selected: ${value}");
    }

    public class ApiResult
    {
        public List<string[]> result { get; set; }
    }
}
